﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Business.DA;
using System.Data.SqlClient;
using Business.VOL;
using System.Data;

namespace Business.BLL
{
    class NguoiDungBL
    {
        private DataAccess dataAccess;

        public NguoiDungBL()
        {
            dataAccess = new DataAccess();
        }

        public bool insertData(NguoiDung obj)
        {
            SqlParameter[] param = new SqlParameter[3];
            param[0] = new SqlParameter("@TenTruyCap", SqlDbType.NVarChar) { Value = obj.TenTruyCap };
            param[1] = new SqlParameter("@HoTen", SqlDbType.NVarChar) { Value = obj.HoTen };
            param[2] = new SqlParameter("@MatKhau", SqlDbType.NVarChar) { Value = obj.MatKhau };
            // cau query select
            string sql = "INSERT INTO tbl_NguoiDung  (TenTruyCap, HoTen, MatKhau) VALUES (@TenTruyCap, @HoTen, @MatKhau)";
            dataAccess.Execute(sql, param);
            return true;
        }
    }
}
